﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        var loc="";
        $(function () {
            console.log("Hi!");
            $('#response').hide();
            loc = document.location.origin;
            //console.log(loc);

        });
        function check()
        {
            loc = document.location;
alert(loc);
            $('#response').hide();
            var url =  "phch.aspx?ID=79001234567&WAIT=30";
		//url="http://www.trusted-net.ru:81/phch.aspx?ID=+79001234567&WAIT=30"; 
            //console.log(url);
alert(url);
            $.ajax({
                type: "GET",
                url: url,
                dataType: "html",
                async: true,
                contentType: "text/xml; charset=utf-8",
                success: function (response, status) {
                    //console.log("success");
alert(status);
                },
                error: function (response, status, estatus) {
alert(estatus);
                    //console.log("error: " + status);
                },
                complete: function (response) {
alert(response.responseText);
                    //console.log("complete: " + response.responseText);
                    document.getElementById("rtext").innerHTML = "Response was: "+response.responseText;
                    $('#response').show();
                }
            });
        }
    </script>

</head>
<body>
    <p>
        <input id="btn" type="button" value="Проверить" onclick="javascvript:check()" /></p>
        <div id="response"><pre id="rtext">tatata</pre></div>

</body>
</html>
